package kk.dao;

import kk.domain.Permission;

import java.util.List;

public interface PermissionDao {

    /**
     * 根据角色的id查询出该角色的权限
     * @param roleId
     * @return
     */
    public List<Permission> findByRoleId(Integer roleId);

    /**
     * 查询所有资源权限
     * @return
     */
    public List<Permission> findAll() throws Exception;

    /**
     * 添加权限
     * @throws Exception
     */
    public void save(Permission permission) throws Exception;

    /**
     * 根据id查询权限
     * @param id
     * @return
     * @throws Exception
     */
    public Permission findById(Integer id) throws Exception;

    /**
     * 根据id删除permission
     * @param id
     * @throws Exception
     */
    public void deleteById(Integer id)throws Exception;
}
